package com.zy.controller;

import com.zy.bean.bo.script.LiteflowScriptBo;
import com.zy.bean.po.LiteflowScript;
import com.zy.service.LiteflowScriptService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : hanhuafeng
 * @date : 2023/11/13 17:33
 */
@RestController
@RequestMapping("/v1/script")
@RequiredArgsConstructor
public class ScriptController {
    private final LiteflowScriptService liteflowScriptService;

    /**
     * 新增liteflow脚本组件
     *
     * @param createBo 新增对象
     * @return 新增结果
     */
    @PostMapping("")
    public LiteflowScript createNewLiteflowScript(@Valid LiteflowScriptBo createBo) {
        return liteflowScriptService.createNewLiteflowScript(createBo);
    }
}
